#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time    : 2021/4/19 下午2:35
# @Author  : fugang_le
# @Software: PyCharm


# 嵌套for循环
from itertools import product

list1 = range(1, 3)
list2 = range(4, 6)
list3 = range(7, 9)
for item1 in list1:
    for item2 in list2:
        for item3 in list3:
            print(item1 + item2 + item3)

print('优化后......')
for item1, item2, item3 in product(list1, list2, list3):
    print(item1 + item2 + item3)
